package com.benny_driving_dri.thread;

import com.benny_driving_dri.act.TaximeterAct2;
import com.benny_driving_dri.dao.impl.HttpDaoImpl;

public class StartTaximeter2Thread extends Thread {
	String jsession;

	public StartTaximeter2Thread(String jsession) {
		this.jsession = jsession;
	}

	@Override
	public void run() {
		long timeMillion;
		if ((timeMillion = new HttpDaoImpl().requestStartTaximeter(jsession)) != 0) {
			if (null != TaximeterAct2.handler)
				TaximeterAct2.handler
						.sendMessage(TaximeterAct2.handler
								.obtainMessage(
										0,
										TaximeterAct2.HANDLER_KEY_TAXIMETER_START_LOOPBACK,
										TaximeterAct2.HANDLER_STATE_SUCCESS,
										timeMillion));
		} else {
			if (null != TaximeterAct2.handler)
				TaximeterAct2.handler
						.sendMessage(TaximeterAct2.handler
								.obtainMessage(
										0,
										TaximeterAct2.HANDLER_KEY_TAXIMETER_START_LOOPBACK,
										TaximeterAct2.HANDLER_STATE_FAIL));
		}
	}

}
